import Tkinter as tk

class Label(tk.Label):
    def __init__(self, master):
        tk.Label.__init__(self, master)

class Button(tk.Button):
    def __init__(self, master):
        tk.Button.__init__(self, master)

class Checkbutton(tk.Checkbutton):
    def __init__(self, master):
        tk.Checkbutton.__init__(self, master)

class Radiobutton(tk.Radiobutton):
    def __init__(self, master):
        tk.Radiobutton.__init__(self, master)

class Entry(tk.Entry):
    def __init__(self, master):
        tk.Entry.__init__(self, master)

class Text(tk.Text):
    def __init__(self, master):
        tk.Text.__init__(self, master)

class Frame(tk.Frame):
    def __init__(self, master):
        tk.Frame.__init__(self, master)

class Canvas(tk.Canvas):
    def __init__(self, master):
        tk.Canvas.__init__(self, master)

class Listbox(tk.Listbox):
    def __init__(self, master):
        tk.Listbox.__init__(self, master)

    ## retrieving actual entries
    def entries(self):
        return list(tk.Listbox.get(self, 0, tk.END))

    def add(self, value):
        # appending new value to the end
        tk.Listbox.insert(self, tk.END, value)
        # sorting content
        self.sort()

        # trying to select and see newly added entry
        index = 0
        for entry in self.entries():
            if entry == value:
                tk.Listbox.selection_set(self, index)
                tk.Listbox.see(self, index)
                break
            index += 1

    ## sorting listbox entries
    def sort(self):
        temp = list(sorted(self.entries()))
        # delete whole content
        self.clear()
        # re-load listbox with sorted data
        tk.Listbox.insert(self, tk.END, *temp)

    ## delete whole content
    def clear(self):
        tk.Listbox.delete(self, 0, tk.END)

class Scale(tk.Scale):
    def __init__(self, master):
        tk.Scale.__init__(self, master)

class LabelFrame(tk.LabelFrame):
    def __init__(self, master):
        tk.LabelFrame.__init__(self, master)

class PanedWindow(tk.PanedWindow):
    def __init__(self, master):
        tk.PanedWindow.__init__(self, master)

class Menu(tk.Menu):
    def __init__(self, master):
        tk.Menu.__init__(self, master, tearoff=0)

class Scrollbar(tk.Scrollbar):
    def __init__(self, master):
        tk.Scrollbar.__init__(self, master)

if __name__ == "__main__":
    pass
